﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using System.IO.IsolatedStorage;

namespace A_larm_Shake
{
    public partial class page_setAlarm : PhoneApplicationPage
    {
        public page_setAlarm()
        {
            InitializeComponent();
        }

        private void bt_set_Click(object sender, EventArgs e)
        {
            string strName = this.tbx.Text;
            string lv = ((ListPickerItem)drop.SelectedItem).Tag.ToString();
            string timess = set_timeSpan.ValueString.ToString();

            IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
            if (!settings.Contains("AlarmData1"))
            {
                settings.Add("AlarmData1", timess);
                settings.Add("AlarmData2", lv);
                settings.Add("AlarmData3", strName);
            }
            else
            {
                settings["AlarmData1"] = timess;
                settings["AlarmData2"] = lv;
                settings["AlarmData3"] = strName;
            }
            settings.Save();
            this.NavigationService.GoBack();
        }

        private void bt_cl_Click(object sender, EventArgs e)
        {
            NavigationService.GoBack();
        }
    }
}